﻿using System.Collections;
using DataAccess;
using Model;

namespace Service
{

    public class PlanningService : ServiceBase
    {
        PlanningDataAccess mgr;
        public PlanningService()
        {
            mgr = new PlanningDataAccess();
        }
      
        public IList GetPlanning (int taskId)
        {
            return mgr.GetListByPropertyValueAndOrder(typeof (Planning), Resource.TaskIdProperty, taskId,
                                               Resource.PlanningDateProperty);
        }
        public Planning GetPlanningByPlanningId(int planningId)
        {
            return mgr.GetPlanningByPlanningId(planningId);
        }

        public void SavePlanning(Planning planning)
        {
            mgr.Save(planning);

        }
        public void DeletePlanning(int planningId)
        {
            mgr.DeleteObject("From Planning where PlanningId =" + planningId);
        }



    }
}
